package com.capgemini.business.service.impl;

import com.capgemini.business.mapper.ProjectManagementMapper;
import com.capgemini.business.mapper.dataobject.ProjectManagement;
import com.capgemini.business.service.ProjectManagementService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class ProjectManagementServiceImpl implements ProjectManagementService {

    private final ProjectManagementMapper projectManagementMapper;

    @Override
    public List<ProjectManagement> list() {
        return projectManagementMapper.selectList(null);
    }

    @Override
    public void save(ProjectManagement projectManagement) {
        projectManagementMapper.insert(projectManagement);
    }

    @Override
    public void update(ProjectManagement projectManagement) {
        projectManagementMapper.updateById(projectManagement);
    }

    @Override
    public void delete(Integer id) {
        projectManagementMapper.deleteById(id);
    }

    @Override
    public ProjectManagement findById(Integer id) {
        return projectManagementMapper.selectById(id);
    }
}
